package com.greatchn.security_demo.web.srv;

import com.greatchn.security_demo.web.po.Menu;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @MenuSrv: 菜单 srv
 * @author: ZBoHang
 * @time: 2023/2/9 15:43
 */
@Service
public class MenuSrv {

    public static final List<Menu> list;

    static {
        list = new ArrayList<Menu>() {
            {
                add(new Menu().setMenuId("login0").setMenuPath("/login/login").setAvailableRoles("ROLE_NO_LOGIN"));
                add(new Menu().setMenuId("user0").setMenuPath("/user/getUser").setAvailableRoles("USER,ADMIN"));
                add(new Menu().setMenuId("admin0").setMenuPath("/admin/getAdmin").setAvailableRoles("ADMIN"));
            }
        };
    }

    /**
     * 获取所有的菜单
     */
    public List<Menu> getAllMenu() {

        return list;
    }
}
